﻿using BlogEntity315.Data;
using BlogEntity315.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace BlogEntity315.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            IndexVm myvm = new IndexVm();
            using(BlogDbContext db = new BlogDbContext()){
                var results = db.Articles.ToList();
                myvm.MyList = results;
            }
            return View(myvm);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}